package com.netease.course;

import javax.annotation.Resource;

public class ScrewDriver {

	public void setHeader(Header header) {
		this.header = header;
	}

		@Resource
	private Header header;

//	public ScrewDriver(Header header)
//	{
//		this.header = header;
//	}

	public void setColor(String color) {
		this.color = color;
	}

	public String color = "red";

	public void use(){
		System.out.println("color " + color + " use " + this);
		System.out.println(header.getInfo());
		header.doWork();
	}

//	public void use() {
//		System.out.println("Use header: " + header.getInfo());
//		header.doWork();
//	}

	public void init()
	{
		System.out.println("Init " + this);
	}

	public void destroy()
	{
		System.out.println("Destroy ");
	}
}
